package lab02.test06;
public class Triangle {
    private double oneEdge;
    private double twoEdge;
    private double threeEdge;
    private double perimeter;
    private double area;
    private boolean triangle;
    public Triangle(){

    }

    public Triangle(double oneEdge, double twoEdge, double threeEdge) {
        this.oneEdge = oneEdge;
        this.twoEdge = twoEdge;
        this.threeEdge = threeEdge;
    }

    public double getOneEdge() {
        return oneEdge;
    }

    public void setOneEdge(double oneEdge) {
        this.oneEdge = oneEdge;
    }

    public double getTwoEdge() {
        return twoEdge;
    }

    public void setTwoEdge(double twoEdge) {
        this.twoEdge = twoEdge;
    }

    public double getThreeEdge() {
        return threeEdge;
    }

    public void setThreeEdge(double threeEdge) {
        this.threeEdge = threeEdge;
    }

    public boolean triangle(){
        if (oneEdge + twoEdge > threeEdge){
            if (oneEdge + threeEdge > twoEdge){
                if (twoEdge + threeEdge > oneEdge){
                    return triangle = true;
                }else
                    return triangle = false;
            }else
                return triangle = false;
        }else
            return triangle = false;
    }
    public double perimeter(){
        perimeter = oneEdge + twoEdge + threeEdge;
        return perimeter;
    }

    public double area(double perimeter){
        double s;
        s = perimeter / 2;
        area = Math.sqrt(s*(s-oneEdge)*(s-twoEdge)*(s-threeEdge));
        return area;
    }
    public void modify(double oneEdge,double twoEdge,double threeEdge){
        this.oneEdge = oneEdge;
        this.twoEdge = twoEdge;
        this.threeEdge = threeEdge;
    }
}
